import 'package:mall/modules/model/goods_entity.dart';
import 'package:json_annotation/json_annotation.dart';

part 'home_entity.g.dart';

@JsonSerializable()
class HomeEntity {
  List<GoodsEntity>? newGoodsList;
  List<HomeModelCouponlist>? couponList;
  List<HomeModelChannel>? channel;
  List<HomeModelGrouponlist>? grouponList;
  List<HomeModelBanner>? banner;
  List<HomeModelBrandlist>? brandList;
  List<GoodsEntity>? hotGoodsList;
  List<HomeModelTopiclist>? topicList;
  List<HomeModelFloorgoodslist>? floorGoodsList;

  HomeEntity({
    this.newGoodsList,
    this.couponList,
    this.channel,
    this.grouponList,
    this.banner,
    this.brandList,
    this.hotGoodsList,
    this.topicList,
    this.floorGoodsList,
  });

  factory HomeEntity.fromJson(Map<String, dynamic> json) => _$HomeEntityFromJson(json);

  Map<String, dynamic> toJson() => _$HomeEntityToJson(this);
}

@JsonSerializable()
class HomeModelCouponlist {
  double? min;
  String? name;
  double? discount;
  int? days;
  int? id;
  String? tag;
  String? desc;

  HomeModelCouponlist({
    this.min,
    this.name,
    this.discount,
    this.days,
    this.id,
    this.tag,
    this.desc,
  });

  factory HomeModelCouponlist.fromJson(Map<String, dynamic> json) => _$HomeModelCouponlistFromJson(json);

  Map<String, dynamic> toJson() => _$HomeModelCouponlistToJson(this);
}

@JsonSerializable()
class HomeModelChannel {
  String? name;
  int? id;
  String? iconUrl;

  HomeModelChannel({
    this.name,
    this.id,
    this.iconUrl,
  });

  factory HomeModelChannel.fromJson(Map<String, dynamic> json) => _$HomeModelChannelFromJson(json);

  Map<String, dynamic> toJson() => _$HomeModelChannelToJson(this);
}

@JsonSerializable()
class HomeModelGrouponlist {
  String? brief;
  String? picUrl;
  double? grouponPrice;
  int? grouponDiscount;
  String? name;
  double? counterPrice;
  int? id;
  double? retailPrice;
  int? grouponMember;

  HomeModelGrouponlist({
    this.brief,
    this.picUrl,
    this.grouponPrice,
    this.grouponDiscount,
    this.name,
    this.counterPrice,
    this.id,
    this.retailPrice,
    this.grouponMember,
  });

  factory HomeModelGrouponlist.fromJson(Map<String, dynamic> json) => _$HomeModelGrouponlistFromJson(json);

  Map<String, dynamic> toJson() => _$HomeModelGrouponlistToJson(this);
}


@JsonSerializable()
class HomeModelBanner {
  bool? deleted;
  String? addTime;
  String? name;
  String? link;
  String? updateTime;
  int? id;
  int? position;
  String? url;
  String? content;
  bool? enabled;

  HomeModelBanner({
    this.deleted,
    this.addTime,
    this.name,
    this.link,
    this.updateTime,
    this.id,
    this.position,
    this.url,
    this.content,
    this.enabled,
  });

  factory HomeModelBanner.fromJson(Map<String, dynamic> json) => _$HomeModelBannerFromJson(json);

  Map<String, dynamic> toJson() => _$HomeModelBannerToJson(this);
}

@JsonSerializable()
class HomeModelBrandlist {
  double? floorPrice;
  String? picUrl;
  String? name;
  int? id;
  String? desc;

  HomeModelBrandlist({
    this.floorPrice,
    this.picUrl,
    this.name,
    this.id,
    this.desc,
  });

  factory HomeModelBrandlist.fromJson(Map<String, dynamic> json) => _$HomeModelBrandlistFromJson(json);

  Map<String, dynamic> toJson() => _$HomeModelBrandlistToJson(this);
}

@JsonSerializable()
class HomeModelTopiclist {
  String? picUrl;
  double? price;
  String? subtitle;
  int? id;
  String? title;
  String? readCount;

  HomeModelTopiclist({
    this.picUrl,
    this.price,
    this.subtitle,
    this.id,
    this.title,
    this.readCount,
  });

  factory HomeModelTopiclist.fromJson(Map<String, dynamic> json) => _$HomeModelTopiclistFromJson(json);

  Map<String, dynamic> toJson() => _$HomeModelTopiclistToJson(this);
}

@JsonSerializable()
class HomeModelFloorgoodslist {
  String? name;
  List<GoodsEntity>? goodsList;
  int? id;

  HomeModelFloorgoodslist({
    this.name,
    this.goodsList,
    this.id,
  });

  factory HomeModelFloorgoodslist.fromJson(Map<String, dynamic> json) => _$HomeModelFloorgoodslistFromJson(json);

  Map<String, dynamic> toJson() => _$HomeModelFloorgoodslistToJson(this);
}
